﻿using BLL;
using Entity;
using Microsoft.AspNetCore.Mvc;
using YunProject.Controllers.Base;

namespace YunProject.Controllers
{
    public class ChartController : BaseController
    {
        ChartBLL chartBLL;
        public ChartController()
        {
            chartBLL = new ChartBLL();
        }
        /// <summary>
        /// 销售数据看板
        /// </summary>
        /// <returns></returns>
        public IActionResult SaleWeb()
        {
            return View();
        }
        [HttpPost]
        public JsonResult SalesMarkCount(string dateType,string dataCount)
        {
            var rsl = new ReturnResult();
            var userObj = LoginInfo();
            if (userObj != null)
            {
                rsl =chartBLL.SalesTotal(userObj["userCode"].ToString(), userObj["dept"].ToString(), userObj["baseCode"].ToString(),dateType,dataCount);
            }
            return Json(rsl);
        }
    }
}
